import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.function.Consumer;

public class Test01 {
    public static void main(String[] args) {
        Set<String> s=new HashSet<>();
        boolean r1=s.add("张三");
        boolean r2=s.add("张三");
        System.out.println(r1);
        System.out.println(r2);
        System.out.println(s);
        s.add("李四");
        s.add("王五");
        System.out.println(s);
        /*Iterator<String> it=s.iterator();
        while(it.hasNext()){
            String str=it.next();
            System.out.println(str);
        }*/
        /*for (String str : s) {
            System.out.println(str);

        }*/
        s.forEach(str->System.out.println(str));


    }
}
